package com.atguigu.eduService.controller;

import com.atguigu.commonUtils.Result;
import com.atguigu.commonUtils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@Api(tags = "用户登录")
@RequestMapping("/eduService/user")
@CrossOrigin
public class EduLoginController {

    @ApiOperation("用户登录")
    @PostMapping("/login")
    public Result<Map<String,String>> login() {
        Map<String,String> map = new HashMap<>();
        map.put("token","admin");
        return ResultUtil.success(map);
    }

    @GetMapping("/info")
    @ApiOperation("返回用户信息")
    public Result<Map<String,String>> info(){
        Map<String,String> map = new HashMap<>();
        map.put("roles","[admin]");
        map.put("name","admin");
        map.put("avatar","https://mrs-oss.oss-cn-beijing.aliyuncs.com/mrs/headPic/0ae13ef0-f3eb-4d2b-9d8d-c2b9291eed0e.jpg");
        return ResultUtil.success(map);
    }


}
